package vn.com.bookstore.domain.model;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @author QuangMinh
 */
public class Transaction implements Serializable {
	private static final long serialVersionUID = 1L;
	private Integer id;
	private int customerId;
	private int bookId;
	private Date transactionDate;
	private Double totalPrice;

	public Transaction() {
	}

	public Transaction(Integer id) {
		this.id = id;
	}

	public Transaction(Integer id, int customerId, int bookId) {
		this.id = id;
		this.customerId = customerId;
		this.bookId = bookId;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public int getCustomerId() {
		return customerId;
	}

	public void setCustomerId(int customerId) {
		this.customerId = customerId;
	}

	public int getBookId() {
		return bookId;
	}

	public void setBookId(int bookId) {
		this.bookId = bookId;
	}

	public Date getTransactionDate() {
		return transactionDate;
	}

	public void setTransactionDate(Date transactionDate) {
		this.transactionDate = transactionDate;
	}

	public Double getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(Double totalPrice) {
		this.totalPrice = totalPrice;
	}

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (id != null ? id.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		// TODO: Warning - this method won't work in the case the id fields are
		// not set
		if (!(object instanceof Transaction)) {
			return false;
		}
		Transaction other = (Transaction) object;
		if ((this.id == null && other.id != null)
				|| (this.id != null && !this.id.equals(other.id))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "vn.com.iflex.Transaction[ id=" + id + " ]";
	}

}
